package com.prothink.service.impl;

import com.prothink.dao.UserCouponDao;
import com.prothink.entity.UserCoupon;
import com.prothink.service.UserCouponService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @description：
 * @author     ：wangchong
 * @date       ：2022/11/12 14:23
 */
@Service
public class UserCouponServiceImpl implements UserCouponService {

    @Autowired
    private UserCouponDao userCouponDao;

    @Override
    public List<UserCoupon> getAll() {
        List<UserCoupon> all = userCouponDao.getAll();
        return all;
    }

    @Override
    public Boolean updateCoupon(Integer online,Integer couponId) {
        Boolean aBoolean = userCouponDao.updateCoupon(online,couponId);
        return aBoolean;
    }

    @Override
    public List<UserCoupon> getScreen(String couponName, Integer grant, Integer online) {
        List<UserCoupon> screen = userCouponDao.getScreen(couponName, grant, online);
        return screen;
    }

    @Override
    public Boolean deleteCoupon(Integer couponId) {
        Boolean aBoolean = userCouponDao.deleteCoupon(couponId);
        return aBoolean;
    }

    @Override
    public Boolean addCoupon(UserCoupon userCoupon) {
        Boolean aBoolean = userCouponDao.addCoupon(userCoupon);
        return aBoolean;
    }

    @Override
    public List<UserCoupon> getCouponUser() {
        List<UserCoupon> couponUser = userCouponDao.getCouponUser();
        return couponUser;
    }

    @Override
    public List<UserCoupon> getScreen2(String userAccount, String nickname) {
        List<UserCoupon> screen2 = userCouponDao.getScreen2(userAccount,nickname);
        return screen2;
    }

    @Override
    public List<UserCoupon> getCouponUserId(Integer userId) {
        List<UserCoupon> couponUserId = userCouponDao.getCouponUserId(userId);
        return couponUserId;
    }

    @Override
    public List<UserCoupon> getCouponId2(Integer userId) {
        List<UserCoupon> couponUserId2 = userCouponDao.getCouponUserId2(userId);
        return couponUserId2;
    }
}
